<!DOCTYPE html	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:sdu="http://sduept.com/jsf/cc">
<h:head>
	<link href="/css/primefaces/menubase.css" rel="stylesheet"
		type="text/css" />
	<title>添加评价厂站</title>
	<style type="text/css">
		.value {
			font-weight: bold;
		}
		
		.ui-tree {
			width: 100%;
			position: relative;
			height: 350px;
			overflow-y: scroll;
		}
		
		.ui-panelgrid .ui-panelgrid-cell {
			border-width: 0px;
		}
		
		.ui-widget-header .ui-inputfield, .ui-widget-content .ui-inputfield {
			font-weight: normal;
			width: 30px;
		}
		
		.expertSelectorTitle {
			color: #555;
			/* background-color: #fff; */
			font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial,
				sans-serif;
			font-weight: 600;
			font-size: 16px;
			padding: 10px 15px;
			line-height: 1.42857143;
		}
		
		.ui-g-6 {
			border: 1px solid #d5d5d5;
			border-radius: 3px;
			width: 49.5%;
		}
		
		.ui-g-12 {
			border: 1px solid #d5d5d5;
			border-radius: 3px;
		}
	</style>
	<script>
		/*关闭该弹窗并返回数据*/
		function closeAndSave(data) {
			//将对象转为JSON字符串
			data = JSON.stringify(data);
			/* alert(data); */
			var index = parent.layer.getFrameIndex(window.name);
			if (parent.dialogReturn) {
				parent.dialogReturn(index, data);
			}
			parent.layer.close(index);
		}
	</script>
</h:head>

<h:body>
	<h:form id="instationSelectorForm" style="font-size:14px">
		<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
			<p:commandButton value="是" type="button"
				styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
			<p:commandButton value="否" type="button"
				styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
		</p:confirmDialog>
		<p:growl id="msgs" showDetail="true" />
		<p:wizard
			flowListener="#{inspectionStationSelectorController.onFlowProcess}"
			nextLabel="下一步" backLabel="上一步">
			<p:tab id="stationSelector" title="变电站">
				<div class="ui-g">
					<div class="ui-g-12" style="margin-bottom: 5px;padding:0px">
						<h:panelGrid columns="2" cellpadding="5">
							<p:outputLabel for="stationType" value="抽检类型:" />
					        <p:selectOneRadio id="stationType" value="#{inspectionStationSelectorController.stationType}" unselectable="true">
					            <f:selectItems value="#{inspectionStationSelectorController.getStationTypes()}" var="type" itemLabel="#{type.label}"/>
					            <p:ajax event="change" />
					        </p:selectOneRadio>
					     </h:panelGrid>
					</div>
				</div>
				<div class="ui-g">
					<div class="ui-g-12">
						<p:toolbar id="stationtoolbar">
							<f:facet name="left">
								<h:outputText value="电压等级:" style="margin-right:10px" />
								<h:selectOneMenu
									value="#{inspectionStationSelectorController.selectedVol}"
									style="width:90px;height:31px;">
									<p:ajax event="change"
										listener="#{inspectionStationSelectorController.changeVoltage}"
										update="stationTree" />
									<f:selectItem itemLabel="全部" itemValue="0" />
									<f:selectItem itemLabel="220kV" itemValue="220" />
									<f:selectItem itemLabel="500kV" itemValue="500" />
									<f:selectItem itemLabel="800kV" itemValue="800" />
								</h:selectOneMenu>
							</f:facet>
						</p:toolbar>
						<p:tree id="stationTree" widgetVar="stationTree" dynamic="true"
							animate="true" var="node" style="border:0"
							value="#{inspectionStationSelectorController.stationRoot}"
							selectionMode="checkbox"
							selection="#{inspectionStationSelectorController.selectedSubStationNodes}">
							<p:ajax event="select"
								listener="#{inspectionStationSelectorController.onStationNodeSelect}" />
							<p:ajax event="unselect"
								listener="#{inspectionStationSelectorController.onStationNodeUnSelect}" />
							<p:treeNode type="root" icon="fa fa-home">
								<h:outputText value="#{node}" />
							</p:treeNode>
							<p:treeNode type="maintenanceUnit" icon="fa fa-home">
								<h:outputText value="#{node}" />
							</p:treeNode>
							<p:treeNode type="station">
								<h:outputText value="#{node}" />
							</p:treeNode>
						</p:tree>
					</div>
					<!-- <div class="ui-g-6">
						<h:outputText class="expertSelectorTitle" value="评价标准"></h:outputText>
						<p:toolbar></p:toolbar>
						<p:tree id="standardTree" widgetVar="standardTree" dynamic="true"
							animate="true" var="node" style="border:0"
							value="#{inspectionStationSelectorController.standardRoot}"
							selectionMode="checkbox"
							selection="#{inspectionStationSelectorController.selectedStandardNodes}">
							<p:ajax event="expand"
								listener="#{inspectionStationSelectorController.onStandardNodeExpand}" />
							<p:ajax event="select"
								listener="#{inspectionStationSelectorController.onStandardNodeSelect}" />
							<p:ajax event="unselect"
								listener="#{inspectionStationSelectorController.onStandardNodeUnSelect}" />
							<p:treeNode type="ROOTNAME" icon="fa fa-file-word-o">
								<h:outputText value="#{node.content}" />
							</p:treeNode>
							<p:treeNode type="INSPECTIONPROJECT" icon="fa fa-files-o">
								<h:outputText value="#{node.content}" />
							</p:treeNode>
							<p:treeNode type="INSPECTIONITME" icon="fa fa-file-o">
								<h:outputText value="#{node.content}" />
							</p:treeNode>
							<p:treeNode type="INSPECTIONREQUIREMENT" icon="fa fa-file-text-o">
								<h:outputText value="#{node.content}" />
							</p:treeNode>
							<p:treeNode type="INSPECTIONCRITERION" icon="fa fa-star-o">
								<h:outputText value="#{node.content}" />
							</p:treeNode>
						</p:tree>
					</div> -->
				</div>
			</p:tab>

			<p:tab id="expertSelector" title="分配专家">
				<div class="ui-g">
					<div class="ui-g-12" style="margin-bottom: 5px">
						<p:toolbar id="expertSelectorToolBar">
							<f:facet name="left">
								<p:commandButton value="保存" icon="fa fa-hdd-o"
									actionListener="#{inspectionStationSelectorController.saveAndClose()}">
									<!-- <p:confirm header="提示" message="确定保存吗？" icon="ui-icon-alert" /> -->
								</p:commandButton>
								<!-- <p:commandButton value="帮助" icon="fa fa-question"
									actionListener="#{inspectionStationSelectorController.openHelpDialog()}" /> -->
							</f:facet>
						</p:toolbar>
						<p:panelGrid id="expertSelectorPanel" cellpadding="5"
							style="width:100%">
							<p:row style="border:0;background: #ccc;">
								<p:column>
									<p:selectBooleanCheckbox
										value="#{inspectionStationSelectorController.auto}"
										itemLabel="一键分配">
										<p:ajax event="change"
											listener="#{inspectionStationSelectorController.handleAuto}"
											update="instationSelectorForm"></p:ajax>
									</p:selectBooleanCheckbox>
									<p:selectBooleanCheckbox style="margin-left:10px"
										value="#{inspectionStationSelectorController.manual}"
										itemLabel="手动分配">
										<p:ajax event="change"
											listener="#{inspectionStationSelectorController.handleManual}"
											update="instationSelectorForm"></p:ajax>
									</p:selectBooleanCheckbox>
								</p:column>
								<p:column style="float:right">
									<p:commandButton value="确定"
										actionListener="#{inspectionStationSelectorController.allot()}"
										update="instationSelectorForm:tree instationSelectorForm:msgs" />
								</p:column>
							</p:row>
							<!-- <p:row style="border:0;">
								<p:column style="padding:0px;">
								<h:panelGrid columns="2" cellpadding="5">
									<p:outputLabel for="stationType" value="变电站类型:" />
							        <p:selectOneRadio id="stationType" value="#{inspectionStationSelectorController.stationType}" unselectable="true">
							            <f:selectItems value="#{inspectionStationSelectorController.getStationTypes()}" var="type" itemLabel="#{type.label}"/>
							            <p:ajax event="change" />
							        </p:selectOneRadio>
							     </h:panelGrid>
								</p:column>
							</p:row> -->
							<!-- <p:row style="border:0">
								<p:column>
									<p:selectBooleanCheckbox value="true" itemLabel="每个评价厂站的专家数：" />
									<p:spinner readonly="true" style="margin-left:10px" min="1"
										max="1"
										value="#{inspectionStationSelectorController.expertNum}" />
								</p:column>
								<p:column></p:column>
							</p:row> -->
						</p:panelGrid>
					</div>
				</div>

				<div class="ui-g">
					<div class="ui-g-6" style="margin-right: 1%">
						<h:outputText class="expertSelectorTitle" value="派出专家"></h:outputText>
						<p:toolbar id="experttoolbar">
							<f:facet name="left">
								<!-- <p:autoComplete placeholder="输入人员首字母可查" id="orgPerson" size="18"
										value="#{addAssessmentPlanController.personName}"
										completeMethod="#{addAssessmentPlanController.completeResponsibles}"
										scrollHeight="400" style="float:left;margin-top:5px;"
										 dropdown="true">
										<p:ajax event="itemSelect" update =""
											listener="#{addAssessmentPlanController.autoCompleteOrgTree}" />
									</p:autoComplete>
									<p:commandButton icon="fa fa-refresh"
										style="margin-left:5px;margin-top:5px;" value="重置"
										actionListener="#{addAssessmentPlanController.refresh}" update="" /> -->
								<!-- <p:commandButton value="确定" actionListener="#{inspectionStationSelectorController.selectExperts}"></p:commandButton> -->
							</f:facet>
						</p:toolbar>
						<p:tree id="expertTree" widgetVar="expertTree" dynamic="true"
							animate="true" var="node" style="border:0"
							value="#{inspectionStationSelectorController.expertRoot}"
							selectionMode="checkbox"
							selection="#{inspectionStationSelectorController.selectedExpertNodes}">
							<p:ajax event="select"
								listener="#{inspectionStationSelectorController.onExpertNodeSelect}" />
							<p:ajax event="unselect"
								listener="#{inspectionStationSelectorController.onExpertNodeUnSelect}"></p:ajax>
							<p:ajax event="collapse" />
							<p:treeNode type="deptRoot" icon="fa fa-home">
								<h:outputText value="#{node}" />
							</p:treeNode>
							<p:treeNode type="dept" icon="fa fa-home">
								<h:outputText value="#{node}" />
							</p:treeNode>
							<p:treeNode type="expert" icon="fa fa-user">
								<h:outputText value="#{node}" />
							</p:treeNode>
						</p:tree>
					</div>

					<div class="ui-g-6">
						<h:outputText class="expertSelectorTitle" value="抽检厂站"></h:outputText>
						<p:toolbar>
						</p:toolbar>
						<p:tree
							value="#{inspectionStationSelectorController.selectedStationsRoot}"
							var="node" dynamic="true" id="tree" widgetVar="tree"
							animate="true"
							selection="#{inspectionStationSelectorController.selectedAllotStationNodes}"
							selectionMode="checkbox" style="border:0">
							<p:ajax event="select"
								listener="#{inspectionStationSelectorController.onAllotStationNodeSelect}" />
							<p:ajax event="unselect"
								listener="#{inspectionStationSelectorController.onAllotStationNodeUnSelect}" />
							<p:ajax event="collapse" />
							<p:treeNode type="deptRoot" icon="fa fa-home">
								<h:outputText value="#{node}" />
							</p:treeNode>
							<p:treeNode type="dept" icon="fa fa-home">
								<h:outputText value="#{node}" />
							</p:treeNode>
							<p:treeNode type="station">
								<h:outputText value="#{node}" />
								<h:outputText style="color:blue"
									value="#{inspectionStationSelectorController.getExpertListStr(node.id)}" />
							</p:treeNode>
						</p:tree>
					</div>

				</div>

			</p:tab>
		</p:wizard>

	</h:form>
</h:body>
</html>
